home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / gnudbm14.zip / UNIX / MAKEFILE < prev    next >
Text File  |  1990-08-14  |  5KB  |  175 lines

  1. # Makefile for gdbm.
  2. #
  3. # for System V, add "-DSYSV" to CFLAGS.  Also, if you need alloca(),
  4. # add "-lPW" to LIBS.
  5. #
  6. # for BSD, nothing is required
  7. #
  8. # for gcc, uncomment the CC = gcc line.
  9.  
  10. #CC = gcc
  11. CFLAGS = -g # -O -DSYSV
  12. LDFLAGS =
  13. LIBS = # -lPW
  14. DBM = -ldbm
  15. NDBM = -lc
  16. LIBC = -lc
  17. LINTFLAGS =
  18.  
  19. DBM_CF = dbminit.c delete.c fetch.c store.c seq.c
  20.  
  21. NDBM_CF = dbmopen.c dbmdelete.c dbmfetch.c dbmstore.c dbmseq.c \
  22.     dbmclose.c dbmdirfno.c dbmpagfno.c
  23.  
  24. GDBM_CF = gdbmopen.c gdbmdelete.c gdbmfetch.c  gdbmstore.c gdbmclose.c \
  25.     gdbmreorg.c gdbmseq.c \
  26.     bucket.c falloc.c findkey.c global.c hash.c update.c version.c
  27.  
  28. HFILES = gdbmdefs.h extern.h gdbmerrno.h systems.h dbm.h ndbm.h
  29.  
  30.  
  31. MSCFILES = COPYING ChangeLog Makefile README gdbm.proto conv2gdbm.c
  32.  
  33. TESTFILES = testdbm.c testndbm.c testgdbm.c
  34.  
  35.  
  36. DBM_OF = dbminit.o delete.o fetch.o store.o seq.o
  37.  
  38. NDBM_OF = dbmopen.o dbmdelete.o dbmfetch.o dbmstore.o dbmseq.o \
  39.     dbmclose.o dbmdirfno.o dbmpagfno.o
  40.  
  41. GDBM_OF = gdbmopen.o gdbmdelete.o gdbmfetch.o  gdbmstore.o gdbmclose.o \
  42.     gdbmreorg.o gdbmseq.o \
  43.     bucket.o falloc.o findkey.o global.o hash.o update.o version.o
  44.  
  45.  
  46. LIBDIR = /usr/lib
  47. INCLUDE = /usr/include
  48.  
  49. default:    
  50.     @echo "\"make gdbm.a\" to make the library"
  51.     @echo "\"make testgdbm\" to make the gdbm test program"
  52.     @echo "\"make testdbm\" to make the dbm compatability test program"
  53.     @echo "\"make testndbm\" to make the ndbm compatability test program"
  54.     @echo "\"make allgdbm\" to make all of the above"
  55.     @echo "\"make tdbm\" to make the dbm test program (uses dbm, not gdbm)"
  56.     @echo "\"make tndbm\" to make the ndbm test program (uses ndbm)"
  57.     @echo "\"make alldbm\" to make the two previous programs"
  58.     @echo "\"make conv2gdbm\" to make the conversion program"
  59.     @echo "\"make all\" to make all of the above"
  60.     @echo "\"make install\" to install the library"
  61.     @echo "\"make dist\" to make gdbm.tar.Z distribution file"
  62.  
  63. all:    allgdbm conv2gdbm alldbm
  64.  
  65. alldbm: tdbm tndbm
  66.  
  67. allgdbm: gdbm.a testgdbm testdbm testndbm
  68.  
  69. gdbm.a:    $(DBM_OF) $(NDBM_OF) $(GDBM_OF) gdbm.h
  70.     rm -f gdbm.a
  71.     ar q gdbm.a $(DBM_OF) $(NDBM_OF) $(GDBM_OF)
  72.     if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
  73.         then ranlib gdbm.a; fi
  74.  
  75. gdbm.h:    gdbm.proto gdbmerrno.h
  76.     cp gdbm.proto gdbm.h
  77.     chmod +w gdbm.h
  78.     grep _ gdbmerrno.h >> gdbm.h
  79.  
  80. install: gdbm.a gdbm.h
  81.     install -c -m 644 gdbm.a $(LIBDIR)/libgdbm.a
  82.     if [ -f /usr/bin/ranlib -o -f /bin/ranlib ]; \
  83.         then ranlib $(LIBDIR)/libgdbm.a; fi
  84.     install -c -m 644 gdbm.h $(INCLUDE)/gdbm.h
  85.  
  86. testgdbm: testgdbm.o gdbm.a
  87.     $(CC) $(CFLAGS) $(LDFLAGS) -o testgdbm testgdbm.o gdbm.a $(LIBS)
  88.  
  89. testdbm: testdbm.o gdbm.a
  90.     $(CC) $(CFLAGS) $(LDFLAGS) -o testdbm testdbm.o gdbm.a $(LIBS)
  91.  
  92. tdbm: testdbm.o gdbm.a
  93.     $(CC) $(CFLAGS) $(LDFLAGS) -o tdbm testdbm.o $(DBM) $(LIBS)
  94.  
  95. testndbm.o: testndbm.c
  96.     $(CC) -c $(CFLAGS) -DGNU testndbm.c
  97.  
  98. testndbm: testndbm.o gdbm.a
  99.     $(CC) $(CFLAGS) $(LDFLAGS) -o testndbm testndbm.o gdbm.a $(LIBS)
  100.  
  101. tndbm.o: testndbm.c
  102.     rm -f tndbm.c
  103.     ln testndbm.c tndbm.c
  104.     $(CC) $(CFLAGS) -c tndbm.c
  105.     rm -f tndbm.c
  106.  
  107. tndbm: tndbm.o gdbm.a
  108.     $(CC) $(CFLAGS) $(LDFLAGS) -o tndbm tndbm.o $(LIBS) $(NDBM)
  109.  
  110. conv2gdbm: conv2gdbm.o gdbm.a
  111.     $(CC) $(CFLAGS) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(DBM) $(LIBC) \
  112.     gdbm.a $(LIBS)
  113.  
  114. lintgdbm: 
  115.     lint $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
  116.  
  117. clean:
  118.     rm -f $(DBM_OF) $(NDBM_OF) $(GDBM_OF) gdbm.h gdbm.a \
  119.     testdbm testndbm testgdbm testdbm.o testndbm.o testgdbm.o \
  120.     tdbm tndbm tndbm.o tndbm.c conv2gdbm conv2gdbm.o
  121.  
  122. dist:
  123.     OF=`sed -n 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/gdbm-\1/p' version.c` \
  124.     ;mkdir $$OF             \
  125.     ;ln $(MSCFILES) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) $(HFILES) \
  126.         $(TESTFILES)  $$OF      \
  127.     ;tar cvohf $$OF.tar $$OF  \
  128.     ;compress $$OF.tar        \
  129.     ;rm -rf $$OF
  130.  
  131.  
  132. # dbm files
  133. dbminit.o:    gdbmdefs.h extern.h gdbmerrno.h systems.h
  134. delete.o:    gdbmdefs.h extern.h
  135. fetch.o:    gdbmdefs.h extern.h
  136. store.o:    gdbmdefs.h extern.h
  137. seq.o:        gdbmdefs.h extern.h
  138.  
  139. # ndbm files
  140. dbmopen.o:    gdbmdefs.h extern.h gdbmerrno.h systems.h
  141. dbmdelete.o:    gdbmdefs.h extern.h
  142. dbmfetch.o:    gdbmdefs.h extern.h
  143. dbmstore.o:    gdbmdefs.h extern.h
  144. dbmseq.o:    gdbmdefs.h extern.h
  145. dbmclose.o:    gdbmdefs.h systems.h
  146. dbmpagfno.o:    gdbmdefs.h extern.h
  147. dbmdirfno.o:    gdbmdefs.h extern.h
  148.  
  149.  
  150. # gdbm files
  151. gdbmclose.o:    gdbmdefs.h systems.h
  152. gdbmdelete.o:    gdbmdefs.h gdbmerrno.h systems.h
  153. gdbmfetch.o:    gdbmdefs.h gdbmerrno.h systems.h
  154. gdbmopen.o:    gdbmdefs.h gdbmerrno.h systems.h 
  155. gdbmreorg.o:    gdbmdefs.h gdbmerrno.h systems.h extern.h
  156. gdbmseq.o:    gdbmdefs.h systems.h
  157. gdbmstore.o:    gdbmdefs.h gdbmerrno.h systems.h
  158.  
  159. # gdbm support files
  160. bucket.o:    gdbmdefs.h systems.h
  161. falloc.o:    gdbmdefs.h systems.h
  162. findkey.o:    gdbmdefs.h systems.h
  163. global.o:    gdbmdefs.h gdbmerrno.h 
  164. hash.o:        gdbmdefs.h
  165. update.o:    gdbmdefs.h systems.h
  166. version.o:
  167. extern.h:    
  168.  
  169. # other programs
  170. testgdbm.o:    gdbmdefs.h extern.h gdbmerrno.h systems.h
  171. testdbm.o:
  172. testndbm.o:    ndbm.h
  173. tdbm.o:
  174. conv2gdbm.o:    gdbm.h
  175.